﻿<% if (Items.length > 0) { %>  
    <% _.each(Items, function(book){%>
    <li class="list-view">
        <div class="best-books-content">
            <a href="@Url.Action(MVC.Books.Index())/<%=book.Id%>"><img alt="<%=book.Name%>" src="@Url.Content("~/Uploads/")<%=book.Avatar%>" /></a>
            <h6><a href="@Url.Action(MVC.Books.Index())/<%=book.Id%>"><%=book.Name%></a></h6>
                  <% if(book.IsCanRate) {%>
                            <ul class="star-rating"  data-val-bookId ="<%=book.Id%>">
                        <%} else { %>
                            <ul class="star-rating disabled">
                        <%}%>
                            <% if(book.Rating==1) {%>
                                <li class="one"></li>
                                <%} else if (book.Rating==2) { %>
                                <li class="two"></li>
                                <%} else if (book.Rating==3) { %>
                                <li class="three"></li>
                                <%} else if (book.Rating==4) { %>
                                <li class="four"></li>
                                <%} else if (book.Rating==5) { %>
                                <li class="five"></li>
                            <%} %>
                            <li><a href="#" data-rate-value="1" title="1 из 5" class="one-star no-link"></a></li>
                            <li><a href="#" data-rate-value="2" title="2 из 5" class="two-stars no-link"></a></li>
                            <li><a href="#" data-rate-value="3" title="3 из 5" class="three-stars no-link"></a></li>
                            <li><a href="#" data-rate-value="4" title="4 из 5" class="four-stars no-link"></a></li>
                            <li><a href="#" data-rate-value="5" title="5 из 5" class="five-stars no-link"></a></li>
                        </ul>
            <p><%=book.ShortDescription%></p>
            <a class="content" href="@Url.Content("~/Uploads/")<%=book.FileName%>">Скачать</a>
        </div>
    </li>
    <% });%>
<% } else { %>
    <li class="empty">There are no books in this category.</li>
<% } %>